<template>
	<view class="mainpage">
		<pageheader :setting="settingdata"></pageheader>
		<view class="topbacks">
			<text class="top_1">完成认证信息</text>
			<text class="top_2">彰显实力获得更多商机</text>
		</view>
		<view class="cards">
			<view class="maininfo">
				<text class="title">个人信息</text>
				<view class="infoline">
					<view class="infoleft">
						<text class="infotitle">手机绑定</text>
						<view class="inforichtitle"><text class="textxing">*</text>登录授权绑定手机号</view>
					</view>
					<!-- 未完成认证noit 完成认证hasit -->
					<view class="hasit" @click="lookphone">已完成去查看</view>
				</view>
				<view class="infoline" style="border: none;">
					<view class="infoleft">
						<text class="infotitle">实名认证</text>
						<view class="inforichtitle"><text class="textxing">*</text>看货交易须实名认证</view>
					</view>
					<view class="noit" @click="tolocalname">{{realname?'去查看':'去完成'}}</view>
				</view>
			</view>
			<view class="maininfo" style="border: none;">
				<text class="title">企业信息</text>
				<!-- <view class="infoline">
					<view class="infoleft">
						<text class="infotitle">实力简介</text>
						<view class="inforichtitle"><text class="textxing">*</text>填写简介彰显苗店实力</view>
					</view>
					<view class="noit">去完成</view>
				</view> -->
				<view class="infoline" style="border: none;">
					<view class="infoleft">
						<text class="infotitle">企业认证</text>
						<view class="inforichtitle"><text class="textxing">*</text>完成认证获取更多商机</view>
					</view>
					<view class="noit" @click="toqiye">{{enterprise?'去查看':'去完成'}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	var _this;
	export default {
		data() {
			return {
				settingdata: {
					name: '认证管理',
					bgColor: '#38BE8C',
					titleColor: '#fff',
					showNav: true,
					showTypes: 0,
					position: "managecenter"
				},
				// 是否企业认证
				enterprise:false,
				// 是否实名认证
				realname:false,
			}
		},
		onLoad(e) {
			_this = this
		},
		onShow() {
			_this.getdata()
		},
		methods: {
			// 获取数据
			getdata() {
				_this.$api.get("authenticationinfo", {}).then(data => {
					_this.enterprise = data.enterprise
					_this.realname = data.realname
				});
			},
			lookphone: function() {
				uni.navigateTo({
					url: "/home/oracle/bingdingphone"
				})
			},
			tolocalname: function() {
				uni.navigateTo({
					url: "/home/oracle/oraclecenter",
					// url: "/home/oracle/autonymyes"
				})
			},
			toqiye: function() {
				uni.navigateTo({
					url: "/home/oracle/companycenter",
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.mainpage {
		background-color: #F2F2F2;
		height: 100vh;

		.topbacks {
			width: 100%;
			height: 320rpx;
			background-color: #38BE8C;
			display: flex;
			flex-direction: column;
			align-items: center;
			padding-top: 68rpx;

			.top_1 {
				color: #FFFFFF;
				font-size: 36rpx;
				font-weight: bold;
			}

			.top_2 {
				margin-top: 25rpx;
				font-size: 26rpx;
				color: #A1E6CC;
			}
		}

		.cards {
			margin: -105rpx 30rpx 0 30rpx;
			background: #FFFFFF;
			border-radius: 20rpx;
			display: flex;
			flex-direction: column;

			.maininfo {
				padding: 0 37rpx 27rpx 36rpx;
				display: flex;
				flex-direction: column;
				border-bottom: 2rpx solid #E6E6E6;

				.title {
					margin-top: 30rpx;
					color: #666666;
					font-size: 28rpx;
					font-weight: bold;
				}

				.infoline {
					padding: 24rpx 0;
					margin-top: 20rpx;
					display: flex;
					flex-direction: row;
					align-items: center;
					justify-content: space-between;
					border-bottom: 2rpx solid #E6E6E6;

					.infoleft {
						display: flex;
						flex-direction: column;

						.infotitle {
							color: #000000;
							font-size: 30rpx;
							font-weight: bold;
						}

						.inforichtitle {
							margin-top: 20rpx;
							color: #999999;
							font-size: 24rpx;

							.textxing {
								color: #FE0000;
							}
						}
					}

					.hasit {
						color: #A7A7A7;
						padding: 19rpx 22rpx;
						border-radius: 8rpx;
						border: 2rpx solid #A7A7A7;
						font-size: 26rpx;
					}

					.noit {
						padding: 19rpx 22rpx;
						border-radius: 8rpx;
						font-size: 26rpx;
						color: #fff;
						background-color: #38BE8C;
					}
				}
			}
		}
	}
</style>
